import 'package:flutter/material.dart';
import 'package:online_study/bean/category.dart';
import 'package:online_study/classify/category_content.dart';
import 'package:online_study/classify/category_list.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//分类
class ClassifyPage extends StatefulWidget {
  @override
  _ClassifyPageState createState() => _ClassifyPageState();
}

class _ClassifyPageState extends State<ClassifyPage> {
  List<Category> list = [];

  @override
  void initState() {
    super.initState();
    Category bean1 = Category();
    bean1.categoryTitle = "万邦文化";
    list.add(bean1);
    Category bean2 = Category();
    bean2.categoryTitle = "职业提升";
    list.add(bean2);
    Category bean3 = Category();
    bean3.categoryTitle = "财务专题";
    list.add(bean3);
    Category bean4 = Category();
    bean4.categoryTitle = "办公软件";
    list.add(bean4);
    Category bean5 = Category();
    bean5.categoryTitle = "开发编程";
    list.add(bean5);
    Category bean6 = Category();
    bean6.categoryTitle = "语言";
    list.add(bean6);
    Category bean7 = Category();
    bean7.categoryTitle = "管理学";
    list.add(bean7);
    Category bean8 = Category();
    bean8.categoryTitle = "艺术类";
    list.add(bean8);
    Category bean9 = Category();
    bean9.categoryTitle = "个人兴趣";
    list.add(bean9);
    Category bean10 = Category();
    bean10.categoryTitle = "运动健身";
    list.add(bean10);
    Category bean11 = Category();
    bean11.categoryTitle = "沟通技巧";
    list.add(bean11);
    Category bean12 = Category();
    bean12.categoryTitle = "沟通技巧";
    list.add(bean12);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: PreferredSize(
          child: AppBar(
            backgroundColor: ThemeColor.colorWhite,
            elevation: ThemeSize.appElevation,
          ),
          preferredSize: Size.fromHeight(0)),
      // appBar: AppBar(
      //   backgroundColor: ThemeColor.colorWhite,
      //   title: AppTitle(ThemeString.classify),
      // ),
      body: Row(
        children: [
          CategoryListPage(list),
          Expanded(child: CategoryContentPage())
        ],
      ),
    );
  }
}
